package com.ohuang.launcher.util;

import android.app.Activity;
import android.app.DialogFragment;
import android.view.View;

public class FragmentFinishActivityClick implements View.OnClickListener {
    private DialogFragment fragment;

    public FragmentFinishActivityClick(DialogFragment fragment) {
        this.fragment = fragment;
    }

    @Override
    public void onClick(View v) {
        v.setVisibility(View.GONE);
        if (fragment != null) {
            Activity activity = fragment.getActivity();
            if (activity != null) {
                activity.finish();
            }
        }
    }
}
